package com.fansl.allround.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author fansl
 * @Description: 短信类型
 * @date 2019/11/4 15:35
 */
@Getter
@AllArgsConstructor
public enum  SmsCodeTypeEnum {
    LOGIN(1,"登录"),
    LOGIN_BIND(2,"登录绑定手机号"),
    ;
    /**
     * 类型
     */
    private final int code;
    /**
     * 描述
     */
    private final String description;

    public static SmsCodeTypeEnum getByCode(int code){
        for (SmsCodeTypeEnum value:SmsCodeTypeEnum.values()){
            if(value.getCode()==code){
                return value;
            }
        }
        return null;
    }
}
